﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Finance/FinanceMaster.master" AutoEventWireup="true" 
	CodeBehind="CreateAccount.aspx.cs" Inherits="WebApplication.Finance.CreateAccoun" Theme="BaselineTheme" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register src="../Controls/PageHeadingBarCtrl.ascx" tagname="PageHeadingBarCtrl" tagprefix="uc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
.saveButton
{
	margin:10px;
}
</style>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<!-- Heading bar -->
<div style="margin:auto; margin-top:0px; width:810px;">
	<uc1:PageHeadingBarCtrl ID="pageHeadingBarCtrl" runat="server" Title="New Account" />
</div>

<!-- Account Details -->
<asp:Panel runat="server" ID="pnlDetails" CssClass="sectionPanel" >
	<table border="0" class="DataTable" style="padding-left:10px";>
		<tr><td colspan="5" class="sectionHeading"><h4>New Account Details</h4></td></tr>
		<tr>
			<td>&nbsp;&nbsp;&nbsp;</td>
			<td class="DataTableLabel">Client:</td>
			<td><asp:DropDownList ID="cboClient" runat="server" AutoPostBack="True" 
					onselectedindexchanged="cboClient_SelectedIndexChanged" ></asp:DropDownList></td>
		</tr>
		<tr>
			<td>&nbsp;&nbsp;&nbsp;</td>
			<td class="DataTableLabel">Client Contacts:</td>
			<td><asp:DropDownList ID="cboClientContact" runat="server"></asp:DropDownList></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Collector:</td>
			<td><asp:DropDownList ID="cboCollector" runat="server"></asp:DropDownList></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Manager:</td>
			<td><asp:DropDownList ID="cboManager" runat="server"></asp:DropDownList></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Client Reference:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtClientReference" runat="server"></asp:TextBox><asp:Button ID="butRandomClientReference" runat="server" Text="..." onclick="butRandomClientReference_Click" Width="32px" /></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">FRL Reference:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtFRLReference" runat="server"></asp:TextBox><asp:Button ID="butRandomFRLReference" runat="server" Text="..." onclick="butRandomFRLReference_Click" Width="32px" /></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Debtor Name:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtDebtorName" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Debtor Client Ref:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtDebtorClientRef" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Trading Style:&nbsp;&nbsp;</td>
			<td><asp:DropDownList ID="cboTradingStyle" runat="server"></asp:DropDownList></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Validated:&nbsp;&nbsp;</td>
			<td><asp:CheckBox ID="chkValidated" runat="server" AutoPostBack="True" />
				<asp:DropDownList ID="cboValidatedBy" runat="server"></asp:DropDownList>
				<asp:TextBox ID="txtValidatedAt" runat="server"></asp:TextBox>
				<asp:CalendarExtender ID="calValidatedAt" runat="server" TargetControlID="txtValidatedAt" Format="dd/MM/yyyy"></asp:CalendarExtender>
			</td>
		</tr>
	</table>
</asp:Panel>

<!-- Debtor Details -->
<asp:Panel runat="server" ID="pnlDebtor" CssClass="sectionPanel" >
	<table border="0" class="DataTable" style="padding-left:10px";>
		<tr><td colspan="6" class="sectionHeading"><h4>Debtor Details</h4></td></tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Name:&nbsp;&nbsp;</td>
			<td>
				<asp:TextBox Width="30px" ID="txtTitle" runat="server"></asp:TextBox>&nbsp;
				<asp:TextBox Width="80px" ID="txtFirstName" runat="server"></asp:TextBox>&nbsp;
				<asp:TextBox Width="30px" ID="txtInitials" runat="server"></asp:TextBox>&nbsp;
				<asp:TextBox Width="80px" ID="txtSurname" runat="server"></asp:TextBox>
			</td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td class="DataTableLabel">Phone1:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtPhone1" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">Address:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtAddressLineA" runat="server"></asp:TextBox></td>
			<td>&nbsp;</td>
			<td class="DataTableLabel">Phone2:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtPhone2" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td><asp:TextBox ID="txtAddressLineB" runat="server"></asp:TextBox></td>
			<td>&nbsp;</td>
			<td class="DataTableLabel">Fax:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtFax1" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">County:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtCounty" runat="server"></asp:TextBox></td>
			<td>&nbsp;</td>
			<td class="DataTableLabel">Mobile1:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtMobile1" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="DataTableLabel">City:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtCity" runat="server"></asp:TextBox></td>
			<td>&nbsp;</td>
			<td class="DataTableLabel">Mobile2:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtMobile2" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="Postcode">Postcode:&nbsp;&nbsp;</td>
			<td><asp:TextBox ID="txtPostcode" runat="server"></asp:TextBox></td>
			<td>&nbsp;</td>
			<td class="DataTableLabel">Email1:&nbsp;&nbsp;</td>
			<td><asp:TextBox Width="180px" ID="txtEmail1" runat="server"></asp:TextBox></td>
		</tr>
		<tr>
			<td></td>
			<td class="Postcode">Country:&nbsp;&nbsp;</td>
			<td><asp:DropDownList ID="cboCountryCode" runat="server"></asp:DropDownList></td>
			<td>&nbsp;</td>
			<td class="DataTableLabel">Email2:&nbsp;&nbsp;</td>
			<td><asp:TextBox Width="180px" ID="txtEmail2" runat="server"></asp:TextBox></td>
		</tr>
	</table>
</asp:Panel>

<!-- Invoices -->
<asp:Panel runat="server" ID="pnlInvoices" CssClass="sectionPanel" >
	<table border="0" class="DataTable" style="padding-left:10px";>
		<tr><td colspan="5" class="sectionHeading"><h4>Invoices</h4></td></tr>
		<tr>
			<td colspan="5">
				<asp:GridView ID="gridInvoice" runat="server" AutoGenerateColumns="False" 
					DataKeyNames="AccountInvoiceId" GridLines="None" ShowHeaderWhenEmpty="true"
					CellPadding="4" onrowcommand="gridInvoice_RowCommand" 
					onrowdatabound="gridInvoice_RowDataBound">
					<Columns>
						<asp:BoundField HeaderText="Arrival Date" DataField="InvoiceDate">
							<HeaderStyle HorizontalAlign="Left" Width="100px" />
							<ItemStyle HorizontalAlign="Left" Width="100px" />
						</asp:BoundField>
						<asp:BoundField HeaderText="Invoice No" DataField="InvoiceNo">					
							<HeaderStyle HorizontalAlign="Left" Width="100px" />
							<ItemStyle HorizontalAlign="Left" Width="100px" />
						</asp:BoundField>
						<asp:BoundField HeaderText="Amount">
							<HeaderStyle HorizontalAlign="Left"  Width="110px" />
							<ItemStyle HorizontalAlign="Left" Width="110px" />							
						</asp:BoundField>
						<asp:BoundField HeaderText="Status">
							<HeaderStyle HorizontalAlign="Left"  Width="140px" />
							<ItemStyle HorizontalAlign="Left" Width="140px" />							
						</asp:BoundField>
						<asp:BoundField HeaderText="Workflow">
							<HeaderStyle HorizontalAlign="Left"  Width="140px" />
							<ItemStyle HorizontalAlign="Left" Width="140px" />							
						</asp:BoundField>
						<asp:ButtonField ButtonType="Button" Text="Delete" CommandName="DeleteInvoice" >
							<HeaderStyle Width="100px" />
							<ItemStyle Width="100px" />
						</asp:ButtonField>
					</Columns>
					<EmptyDataTemplate>
						<div style="text-align:center;" class="Instructions">There are no invoices for this account.</div>
					</EmptyDataTemplate>
				</asp:GridView>
			</td>
		</tr>
		<tr>
			<td width="108px"><asp:TextBox ID="txtNewDate" runat="server" Width="76px"></asp:TextBox>
				<asp:CalendarExtender ID="calNewDate" runat="server" TargetControlID="txtNewDate" Format="dd/MM/yyyy"></asp:CalendarExtender>
			</td>
			<td width="102px"><asp:TextBox ID="txtNewInvoiceNo" runat="server" Width="62px" ></asp:TextBox></td>
			<td width="112px" nowrap="nowrap"><asp:DropDownList ID="cboCurrency" runat="server" Width="34px" ></asp:DropDownList>&nbsp;<asp:TextBox ID="txtNewAmount" runat="server" Width="56px" CssClass="rightAlign"></asp:TextBox></td>
			<td width="140px"><asp:DropDownList ID="cboNewStatus" runat="server" ></asp:DropDownList></td>
			<td width="300px"><asp:DropDownList ID="cboNewWorkflow" runat="server" ></asp:DropDownList></td>
		</tr>
		<tr>
			<td><asp:Button ID="butAdd" runat="server" Text="Add" onclick="butAdd_Click" /></td>
		</tr>
		
	</table>
</asp:Panel>

<!-- Options -->
<asp:Panel runat="server" ID="pnlOptions" CssClass="sectionPanel" >
	<asp:Button ID="butSave" runat="server" Text="Save" CssClass="saveButton" OnClick="butSave_Click" />
</asp:Panel>

<!-- Links -->
<div style="margin:auto; padding-top:32px; width:810px; text-align:right;">
<asp:hyperlink ID="hypDevAccountList" runat="server" 
		NavigateUrl="~/Finance/AccountList.aspx" CssClass="BaselineLinkStyle">Account List</asp:hyperlink>
</div>

</asp:Content>
